<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <script type="text/javascript" src="../static/dist/layui.js"></script>
    <link rel="stylesheet" href="../static/dist/css/layui.css">
    <script type="text/javascript" src="../static/dist/tableSelect.js"></script>
    <title>TableSelect</title>
    <style>
        .layui-table-cell{
            text-align:center;

            height: auto;

            white-space: normal;

        }

        .layui-table img{
            max-width:300px
        }
    </style>
</head>

<body>
<div class="layui-row layui-bg-black" >
    <div class="layui-col-md1 layui-bg-black">
        <a href="http://localhost:5000">
            <img src="../static/logo.png" class="layui-logo" style="height:55px">
        </a>
        <!--        <p style="padding:27px"></p>-->
    </div>
    <div class="layui-col-md8 layui-bg-black">
        <form class="layui-form" action="" style="padding:11px">
            <div class="layui-form-item" style="height: 18px">
                <!--                <label class="layui-form-label"></label>-->
                <div class="layui-input-inline" style="width:850px">
                    <input type="text" name="" placeholder="请输入" autocomplete="off" class="layui-input" id="search">
                </div>
                <button type="button" class=" layui-btn layui-btn-primary  layui-btn-warm">
                    <i class="layui-icon layui-icon-search"></i>
                </button>
            </div>
        </form>
    </div>
    <div class="layui-col-md3 layui-bg-black" >
        <ul class="layui-nav" style="padding:0px;bottom: 3px">
            <ul class="layui-nav" style="padding:0px;bottom: 3px">
            {% if user %}
                <li class="layui-nav-item">
                    <a href="/user/manage"><img src="../static/yang.jpeg" class="layui-nav-img">我</a>
                    <dl class="layui-nav-child">
                        <dd><a href="/user/manage">订单信息</a></dd>
                        <dd><a href="/user/info">用户信息</a>
                        <dd><a href="/password">修改密码</a></dd>
                        <dd><a href="/loginout">退了</a></dd>
                    </dl>
                </li>
            {% else %}

                <li class="layui-nav-item">
                    <a href="">注册/登录</a>
                    <dl class="layui-nav-child">
                        <dd><a href="http://localhost:5000/register">注册</a></dd>
                        <dd><a href="http://localhost:5000/login">登录</a></dd>
                    </dl>
                </li>
            {% endif %}
            <li class="layui-nav-item">
                <a href="/user/car">购物车</a>
            </li>
            <li class="layui-nav-item">
                <a href="/chat">客服<span class="layui-badge-dot"></span></a>
            </li>


        </ul>

    </div>
</div>

<div class="layui-row  layui-bg-cyan" style="padding: 8px">
    <div class="layui-col-md1" style="left: 20px">
        <button type="button" class="layui-btn layui-btn-xs" >
            <a href="/show/shop">全部</a>
        </button>
    </div>
    <div class="layui-col-md11" style="right: 20px">
         <span class="layui-breadcrumb" lay-separator="|">
             <a href="javascript:;" data-type="1">酒水饮料</a>
        <a href="javascript:;" data-type="2">当季水果</a>
        <a href="javascript:;" data-type="3">面包糕点</a>
        <a href="javascript:;" data-type="4">肉干卤味</a>
        <a href="javascript:;" data-type="5">糖果果冻</a>
        <a href="javascript:;" data-type="6">膨化食品</a>
        <a href="javascript:;" data-type="8">饼干曲奇</a>
        <a href="javascript:;" data-type="9">坚果炒货</a>
        <a href="javascript:;" data-type="10">蛋糕甜品</a>
        <a href="javascript:;" data-type="11">蛋挞披萨</a>
         </span>

    </div>
</div>




<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>



</body>
<script type="text/javascript">
    var form = layui.form;
    form.render();
    var tableSelect = layui.tableSelect;


    tableSelect.render({
        elem: '#search',
        checkedKey: 'id',
        table: {
            url: '../node_modules/layui/table.json',
            cols: [[
                { type: 'radio' },
                { field: 'id', title: 'ID' },
                { field: 'username', title: '姓名' },
                { field: 'sex', title: '性别' }
            ]]
        },
        done: function (elem, data) {
            var NEWJSON = []
            layui.each(data.data, function (index, item) {
                NEWJSON.push(item.username)
            })
            elem.val(NEWJSON.join(","))
        }
    })
</script>

</html>